<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">

        <title>注册</title>

        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="js/jquery/jquery.mobile-1.4.5.min.css"/>

        <link rel="stylesheet" href="css/total/index.css" />
        <link rel="stylesheet" href="css/total/button.css" />
    </head>

    <body>
        <div data-role="page" id="register">
            <div role="main" data-role="ui-content">
                <image src="img/头像.png" class="imghead" />
                <div class="register-fromgroup">
                    <form action="function/register.php" method="post" id="register_form">
                        <div class="register-from-user">
                            <input type="text" name="username" placeholder="用户名" />
                        </div>
                        <div class="register-from-tel">
                            <input type="number" name="phone" placeholder="手机号码">
                        </div>
                        <div class="register-from-password">
                            <input type="password" name="passwd" placeholder="密码" />
                        </div>
                        <div class="register-from-passwordagain">
                            <input type="password" name="passwdagain" placeholder="确认密码" />
                        </div>
                        <div class="register-btn-register">
                            <!--<a href="login.html" class="btn">注册</a>-->
                            <input type="submit" class="btn" value="注册" />
                        </div>
                    </form>
                    <div data-role="none">
                        <a data-role="none" href="login.html"><h5  class="register-a-login" >已有账户？</h5></a>
                    </div>
                </div>
            </div>
        </div>

        <script src="js/jquery/jquery-1.12.0.min.js"></script>
        <script src="js/jquery/jquery.mobile-1.4.5.min.js"></script>
        <script src="js/jquery.form.js"></script>
        <script>
            $(function () {
                $("#register_form").ajaxForm(function (data) {
                    var obj = eval("(" + data + ")");
                    if (obj.status != "ok") {
                        alert(obj.message);
                    } else {
                        // 转入新的url
                        window.location.href = obj.data;
                    }
                });
            });
        </script>
    </body>
</html>